<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
class Push_log extends MY_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->verify_user();
	}

	public function index()
	{
		$flag = intval($this->input->get('flag'));

		if ($flag == 0) {
			$d = $this->result_list(array('table' => 'deal', 'where' => 'buy_user_id=' . $this->user['id'], 'order' => 'add_time desc', 'url' => 'pash_manage/deal_log', 'per_page' => 10));
		}
		else {
			$d = $this->result_list(array('table' => 'deal', 'where' => 'sell_user_id=' . $this->user['id'], 'order' => 'add_time desc', 'url' => 'pash_manage/deal_log', 'per_page' => 10));
		}

		foreach ($d['list'] as $k => $v) {
			$d['list'][$k]['coin'] = $this->d->find(array('table' => 'coin', 'where' => 'id=' . $v['coin_id']));
			$d['list'][$k]['push'] = $this->d->find(array('table' => 'push', 'where' => 'id=' . $v['push_id']));
		}

		$d['flag'] = $flag;
		$this->show(array('header', 'user_left', 'push_log', 'footer'), $d);
	}
}

?>
